<%= form_for(@event) do |f| %>
	<% if @event.errors.any? %>
		<tr>
			<td colspan=2>
				<div id="error_explanation">
					<h2>
						<%= pluralize(@event.errors.count, "error") %> prohibited this event from being saved:
					</h2>

					<ul>
						<% @event.errors.full_messages.each do |msg| %>
						<li><%= msg %></li>
						<% end %>
					</ul>
				</div>
			</td>
		<tr>
	<% end %>

	<tr>
		<div class="field">
			<td><%= f.label :name %></td>
			<td><%= f.text_field :name %></td>
		</div>
	</tr>
	<tr>
	<div class="field">
		<td><%= f.label :start_time %></td>
		<td><%= f.datetime_select :start_time %></td>
	</div>
	</tr>
	<tr>
	<div class="field">
		<td><%= f.label :end_time %></td>
		<td><%= f.datetime_select :end_time %></td>
	</div>
	</tr>
	<tr>
	<div class="field">
		<td><%= f.label :description %></td>
		<td><%= f.text_area :description %></td>
	</div>
	</tr>
	<tr>
	<div class="field">
		<td><%= f.label :age_restriction %></td>
		<td><%= f.check_box :age_restriction %></td>
	</div>
	</tr>
	<tr>
	<div>
		<tr>
			<td colspan=2 class="heading">Select categories for your event:</td>
		</tr>
		<% for tag in Tag.find(:all) %>  
			<tr>
				<td>&nbsp;</td>
				<td>
					<%= check_box_tag "event[tag_ids][]", tag.id, @event.tags.include?(tag) %>  
					<%= tag.name %>  
				</td>
			</tr>
		<% end %>
		
	</div>
	</tr>
	<tr>
		<td colspan=2 align="center">
			<div class="actions">
				<%= f.submit %>
			</div>
		</td>
	</tr>
<% end %>
